package cn.edu.scau.cmi.zhangweiming.simpleFactoryMethod;
import cn.edu.scau.cmi.zhangweiming.simpleFactoryMethod.domain.*;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.ResourceBundle;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class MeatFactory_controller {	
	@FXML
	   private Button Pork;
	@FXML
	   private Button Beef;
	@FXML
	   private Button Chicken;
	@FXML
	   private TextArea	myTextArea;
	
	public void product (ActionEvent event) {
		Object obj=event.getSource();
		if(Pork.equals(event.getSource())) {
			Pork pork=new Pork();
			myTextArea.appendText(pork.product());
			myTextArea.appendText("\n");
		}
		if(obj==Beef) {
			Beef beef=new Beef();
			myTextArea.appendText(beef.product());
			myTextArea.appendText("\n");
		}
		if(obj==Chicken) {
			Chicken chicken=new Chicken();
			myTextArea.appendText(chicken.product());
			myTextArea.appendText("\n");
		}
	}
}
